<?php 
require_once 'sesi_login.php';
require_once 'konfigurasi.php';


define('PAGE', 'Aktifitas Jaksa');
define('PAGE_ICO', 'icon-notes-2');
define('PAGE_URL', 'jaksa.akifitas.php');

koneksi_buka();
panggil_header();
?>

<!-- Content Area -->
<div id="da-content-area">
<div class="row-fluid">

<div class="span12">
	<div class="da-panel collapsible">
		<div class="da-panel-header">
			<span class="da-panel-title">
				<i class="icon-notes-2"></i> Aktifitas Jaksa
			</span>
		</div>
		<?php if(LEVEL=="superadmin" || LEVEL=="sekretariat" || LEVEL=="penuntutan" ) { ?>
		<div class="da-panel-toolbar">
			<div class="btn-toolbar">
				<div class="btn-group">
					<a href="spdp.php" class="btn"><i class="icol-add"></i> Tambah SPDP</a>
				</div>
			</div>
		</div>
		<?php } ?>
		<div class="da-panel-content da-table-container">
			<table id="da-ex-datatable-numberpaging" class="da-table">
				<thead>
					<tr>
						<th>No</th>
						<th>Jaksa</th>
						<th>Perkara</th>
						<th>Posisi</th>
						<th>Tanggal</th>
						<th></th>
					</tr>
				</thead>
				<tbody>
					<?php 
						
						$q = mysql_query("select a.id as a_id, a.kd_perkara as kd_perkara, c.nm_lengkap as nm_lengkap, a.tanggal as tanggal, a.posisi as posisi
									from t_jaksa_aktifitas a 
									left join (
											select a.kd_pegawai as 'kd_pegawai', a.nm_lengkap as 'nm_lengkap', b.nm_jabatan as 'nm_jabatan' 
											from t_pegawai a left join r_jabatan b on a.kd_jabatan=b.kd_jabatan where b.kd_jabatan in(6,7,8)
											) c on a.kd_pegawai = c.kd_pegawai
									group by a_id");
						$i=1;
						while($dt = mysql_fetch_array($q)) {
					?>
					<tr>
						<td><?php echo $i; $i++; ?></td>
						<td><?php echo $dt['nm_lengkap']; ?></td>
						<td><?php echo $dt['kd_perkara']; ?></td>
						<td><?php echo $dt['posisi'] ?></td>
						<td><?php echo konversi_tanggal('d-m-Y',$dt['tanggal']); ?></td>
						<td>
							<a href="jaksa.history.php?kd=<?php echo $dt['a_id'] ?>" rel="tooltip" data-placement="top" title="History"><i class="icol-application-view-detail"></i></a>
						</td>
					</tr>
					<?php } ?>
					
				</tbody>
			</table>
		</div>
	</div>
</div>

</div>
</div>

<?php
panggil_footer();
koneksi_tutup();
?>
